#!/bin/bash

while getopts "h" Option
do
 case $Option in
  h ) echo "Usage: `basename $0`"\
       "[-h] data_file.octxt"
      echo "Fix the data file so that it is completely compatible with"
      echo "octave. Currently, this includes the following fixes:"
      echo "  Infinity -> Inf"
      echo
      echo "  -h  display this help"
      exit;;
 esac
done
shift $(($OPTIND - 1))


old_file_suffix=.fix_octave_notation.old
for x in $@
 do
  # Infinity -> Inf
  mv ${x} ${x}${old_file_suffix}
  sed "s/Infinity/Inf/g" ${x}${old_file_suffix} > ${x}
  rm ${x}${old_file_suffix}
done

